feat(anolisa): add update check#1413
Conversation
- add --check/--motd/--refresh/--target flags to update - detect rpm cli/component upgrades via read-only rpm/dnf queries - add rpm_evr_cmp/rpmvercmp for correct RPM EVR ordering - report missing target-profile defaults as installable - cache update-check reports by target for MOTD use - keep --check read-only: no dnf transaction or state writes Assisted-by: Codex Signed-off-by: 空澈 <kongche.jbw@alibaba-inc.com>
|
审查后我看到 3 个需要处理的问题:
我跑过的验证:
|
|
@ikunkun-sys fresh |
|
复审了最新 head
Findings
验证
|
|
Follow-up:这里是否需要把 profile TOML 编译进二进制? 现在只有
两种都能工作,但现在是 mixed model:latest 内置,v1.0 不内置且不分发,所以显式 |
3097f17 to
066a7c6
Compare
Use a release-owned latest profile as the default target for `update --check`, while keeping profile lookup data-driven. Resolve omitted targets through the same lookup path as explicit targets so on-disk latest profiles override the built-in fallback. Keep only the latest bootstrap profile in the binary; versioned target profiles remain external data assets for the future profile source.
066a7c6 to
8494672
Compare
|
@ikunkun-sys Thanks, updated. The transition model is now: only Also fixed the lookup inconsistency: omitted Verified:
|
Description
Adds a read-only upgrade-detection entry
anolisa update --checkfor theRPM / system-image scenario (issue #1410). It reports whether the RPM-owned
CLI and installed RPM components have newer repo candidates, and — with
--target <profile>— which profile default components are missing. It neverapplies changes: only read-only
rpm -q/dnf repoqueryqueries, noPackageTransaction, noinstalled.tomlwrites, no repo/adapter persistence(repo config is loaded via the dry-run path so a missing config is never
written).
--motdrenders a short, cache-backed summary for a login hook;--refreshbypasses the cache. Existingupdate/update self/update all/
update <component>semantics are unchanged.Candidate ordering uses a new platform-layer
rpm_evr_cmp(a faithfulrpmvercmpport) instead of semver, so real EVRs (epochs,.al4releases,two-segment versions) are compared the way dnf would. Applying upgrades is a
separate command (
anolisa upgrade, issue #1411).Related Issue
closes #1410
Type of Change
Scope
cosh(copilot-shell)cosh-ng(cosh-ng)sec-core(agent-sec-core)skill(os-skills)sight(agentsight)tokenless(tokenless)ckpt(ws-ckpt)memory(agent-memory)anolisa(anolisa-cli)skillfs(SkillFS)Checklist
cosh: Lint passes, type check passes, and tests passcosh-ng:cargo clippy --all-targets -- -D warningsandcargo fmt --checkpasssec-core(Rust):cargo clippy -- -D warningsandcargo fmt --checkpasssec-core(Python): Ruff format and pytest passskill: Skill directory structure is valid and shell scripts pass syntax checksight:cargo clippy -- -D warningsandcargo fmt --checkpasstokenless:cargo clippy -- -D warningsandcargo fmt --checkpassmemory(Linux only):cargo clippy --all-targets -- -D warnings,cargo fmt --check, andcargo testpassanolisa:cargo clippy --all-targets --locked -- -D warnings,cargo fmt --all --check, andcargo test --lockedpassskillfs:cargo fmt --all --check,cargo clippy --workspace --all-targets -- -D warnings, andcargo test --workspacepasspackage-lock.json/Cargo.lock)Testing
cargo test -p anolisa-cli --locked(438 passed) andcargo test -p anolisa-platform --locked(77 passed).update_check_*tests cover: flag parsing/rejection, JSON shape,rpm component update/noop, non-semver EVR upgrade detection, raw component
unsupported_in_rpm_upgrade, missing target-profile defaults, item-levelquery/rpmdb errors, MOTD text/silence, cache round-trip + target-keying,
and read-only repo-config load.
rpmvercmp/rpm_evr_cmptests against RPM reference cases (epoch,leading zeros,
~/^, numeric-vs-alpha).cargo fmt --all --check,cargo clippy --workspace --all-targets --locked -- -D warnings, andcargo doc --no-depsall clean.Additional Notes
update --checkis registered asReadOnlyin the command policy so theMOTD hook can run it unprivileged (it is not gated behind the mutating-update
root requirement).
default_componentsonly) since the repo-side profile schema is not finalized; it tolerates
unknown keys for forward compatibility.
--checkstill issuesdnf repoqueryfor candidates (a read-only,network-touching query), which is why the MOTD path is cache-backed.